package java0.bio;

import com.ejlchina.okhttps.HttpResult;
import com.ejlchina.okhttps.OkHttps;

/**
 * @author lxf {@link 286319801@qq.com}
 * @description  用Okhttps访问 http server接口
 * @date 2021-09-25
 */
public class OkhttpsDemo {

    public static void main(String[] args) {
        HttpResult httpResult = OkHttps.sync(" http://localhost:8801")
                .get();
        if (httpResult.isSuccessful()) {
            System.out.println(httpResult.getBody().toString());
        } else {
            System.err.println("请求失败");
        }
    }
}
